g02faf

g02faf © Numerical Algorithms Group, 2002.

Purpose

G02FAF Calculates standardized residuals and influence statistics

Synopsis

[sres,ifail] = g02faf(n,ip,res,h,rms<,ifail>)

Description

 
 For the general linear regression model
 
                        y=X(beta)+(epsilon)
 
 where y is a vector of length n of the dependent variable,
       
       X is an n by p matrix of the independent variables,
       
       (beta) is a vector of length p of unknown parameters,
 
 and   (epsilon) is a vector of length n of unknown random errors 
                                     2 
       such that var(epsilon)=(sigma) I.
 
 The residuals are given by:
 
                              ^    ^^^^^^
                          r=y-y=y-X(beta)
 
                    ^  ^^^^^^                                    
 The fitted values, y=X(beta), can be written as Hy for an n by n 
 matrix H. The ith diagonal elements of H, h , give a measure of 
                                            i                   
 the influence of the ith values of the independent variables on 
 the fitted regression model. The values of r and the h  are 
                                                       i    
 returned by G02DAF.
 
 G02FAF calculates statistics which help to indicate if an 
 observation is extreme and having an undue influence on the fit 
 of the regression model. Two types of standardised residual are 
 calculated:
 
 (a)   The ith residual is standardised by its variance when the 
                          2   2                                  
       estimate of (sigma) , s , is calculated from all the data; 
       known as internal studentization.
                                      r 
                                       i
                              RI = --------
                                i      ____
                                   s  /1-h 
                                    \/    i
 
 (b)   The ith residual is standardised by its variance when the 
                          2   2                             
       estimate of (sigma) , s   is calculated from the data 
                              -i                            
       excluding the ith observation; known as external 
       studentization.
                             r              ________
                              i            /  n-p-1
                    RE = ----------=r     /  -------
                      i        ____  i   /         2
                         s    /1-h      /    n-p-RI 
                          -i\/    i   \/           i
 
 The two measures of influence are:
 
 (a)   Cook's D
                                        h 
                                  1  2   i
                              D = -RE  ----
                               i  p  i 1-h 
                                          i
 
 (b)   Atkinson's T
                                    _____________
                                   /      (  h  )
                                  / ( n-p)(   i )
                      T =|RE |   /  ( ---)( ----).
                       i    i   /   (  p )( 1-h )
                              \/          (    i)
 

Parameters

g02faf

Required Input Arguments:

n                                     integer
ip                                    integer
res (:)                               real
h (:)                                 real
rms                                   real

Optional Input Arguments:                       <Default>

ifail                                 integer  -1

Output Arguments:

sres (:,4)                            real
ifail                                 integer